#include "common.h"
#include "endian.h"

Iu32 le32toh_(Iu32 u32)
{
    assert( ENDIANNESS != UNKNOWN );
    if(ENDIANNESS != LITTLE) {
        u32 = NET_ULONG(u32);
    }
    return u32;
}

Iu32 be32toh_(Iu32 u32)
{
    assert( ENDIANNESS != UNKNOWN );
    if(ENDIANNESS != BIG) {
        u32 = NET_ULONG(u32);
    }
    return u32;
}

Iu16 le16toh_(Iu16 u16)
{
    assert( ENDIANNESS != UNKNOWN );
    if(ENDIANNESS != LITTLE) {
        u16 = NET_USHORT(u16);
    }
    return u16;
}

Iu16 be16toh_(Iu16 u16)
{
    assert( ENDIANNESS != UNKNOWN );
    if(ENDIANNESS != BIG) {
        u16 = NET_USHORT(u16);
    }
    return u16;
}
